package com.zhang.crm.controller;

import com.github.pagehelper.PageInfo;
import com.zhang.crm.pojo.TActivityRemark;
import com.zhang.crm.result.R;
import com.zhang.crm.service.ActivityRemarkService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;


@RestController
public class ActivityRemarkController {
    @Resource
    private ActivityRemarkService activityRemarkService;
    @GetMapping("api/getMarketRemark")
    public R getMarketRemark(@RequestParam("marketId")Integer marketId, @RequestParam("current") Integer current) {
        PageInfo<TActivityRemark> remarkById = activityRemarkService.getRemarkById(marketId, current);
        return R.OK(remarkById);
    }

    @PostMapping("api/addRemark")
    public R addRemark(@RequestBody TActivityRemark tActivityRemark) {
        Boolean b = activityRemarkService.addRemark(tActivityRemark);
        return b ? R.OK() : R.FAIL("添加失败");
    }
}
